#include <iostream>

using namespace std;

int n;
string s1, s2;

int main()
{
	cin >> n >> s1 >> s2;
	
	for (int i = 0; i < n; i ++ )
	{
		if (s1[i] < s2[i])
		{
			puts("-1");	
			return 0;
		}
	}
	
	cout << s2 << endl;
	
	return 0;
} 
